From: Marco Trevisan (TreviƱo) Date: Mon, 16 Feb 2026 20:45:09 +0000 (+0100) Subject: search: Remove callback on updateSearch and only rely on async API X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~26^2~1^2~54 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a02b628e07216a30ef7266b3f123ee663f929abc;p=gnome-shell.git search: Remove callback on updateSearch and only rely on async API Using a callback in an async function does not make much sense, so let's just use the async API Part-of: --- diff --git a/js/ui/search.js b/js/ui/search.js index 32a934f43..361475e2f 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -250,12 +250,11 @@ const SearchResultsBase = GObject.registerClass({ }); } - async updateSearch(providerResults, terms, callback) { + async updateSearch(providerResults, terms) { this._terms = terms; if (providerResults.length === 0) { this._clearResultDisplay(); this.hide(); - callback(); } else { const maxResults = this._getMaxDisplayedResults(); const results = maxResults > -1 @@ -275,10 +274,8 @@ const SearchResultsBase = GObject.registerClass({ resultId => this._addItem(this._resultDisplays[resultId])); this._setMoreCount(this.provider.canLaunchSearch ? moreCount : 0); this.show(); - callback(); } catch { this._clearResultDisplay(); - callback(); } } } @@ -705,7 +702,7 @@ export const SearchResultsView = GObject.registerClass({ } this._results[provider.id] = results; - this._updateResults(provider, results); + await this._updateResults(provider, results); } _doSearch() { @@ -851,16 +848,18 @@ export const SearchResultsView = GObject.registerClass({ } } - _updateResults(provider, results) { + async _updateResults(provider, results) { const terms = this._terms; const display = provider.display; - display.updateSearch(results, terms, () => { + try { + await display.updateSearch(results, terms); + } finally { provider.searchInProgress = false; this._maybeSetInitialSelection(); this._updateSearchProgress(); - }); + } } activateDefault() {